<?php
require("./library/loader.php");
require("./library/registry.php");
require("./library/frontcontroller.php");
require("./library/route.php");
require("./library/db.php");
require("./library/model.php");

session_start();
$registry=Registry::getInstance();
$frontcontroller=FrontController::getInstance();
$registry->set("frontcontroller",$frontcontroller);
$route=Route::getInstance();
$registry->set("route",$route);
set_include_path('.' . PATH_SEPARATOR .$frontcontroller->getRootDir()."library/". PATH_SEPARATOR.$frontcontroller->getRootDir()."library/pear/".PATH_SEPARATOR. get_include_path());
define("ROOTDIR",$frontcontroller->getRootDir());
define("BASEURL",$frontcontroller->getBaseUrl());
define("MODELDIR",ROOTDIR."application/models/");
define("URL_SUFFIX",".html");
define("SECRET_KEY","12345678");
//$db=new Db("mysql",array("host"=>"localhost","user"=>"root","pword"=>"","dbname"=>"ruby"));
$db=new Db("access",array("dbname"=>ROOTDIR."db/test.mdb"));
$registry->set("db",$db);
$frontcontroller->execute();